package sparrowGui.component
{
	import flash.display.DisplayObjectContainer;
	import flash.display.Sprite;
	import flash.events.Event;
	
	/**
	 * 富文本的提示工具
	 * @author Pelephone
	 */
	public class RichToolTip extends ToolTip
	{
		/**
		 * 表情文本控件
		 */
		private var _richTxt:RichTextField;
		
		/**
		 * 构造富文本提示工具
		 * @param parentSkin
		 * @param argSkin
		 */
		public function RichToolTip(parentSkin:DisplayObjectContainer, argSkin:Sprite=null)
		{
			super(parentSkin, argSkin);
		}
		
		override protected function create(argSkin:Sprite):void
		{
			super.create(argSkin);
			_richTxt = new RichTextField(txtTip,skin);
		}
		
		override public function update(data:Object):void
		{
			richTxt.htmlText = String(data);
			draw();
			dispatchEvent(new Event(TIPS_UPDATA));
		}
		
		/**
		 * 注册表情类
		 * @param tClass
		 * @param name
		 */
		public function registerClass(tClass:Class,name:String):void
		{
			_richTxt.registerClass(tClass,name);
		}

		/**
		 * 富文本
		 */
		public function get richTxt():RichTextField
		{
			return _richTxt;
		}
	}
}